


namespace Flit.Samples.DatabaseSchema
{
	public partial class Database : FluentStateBase
	{
		
		public Database(string name){
			this.Name = name;
		}
		
		#region Data
		public string Name {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnGetTable(string name);
		public Table GetTable(string name) 
		{
			Table __newFragment = new Table(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnGetTable(name);
			return __newFragment;
		}
		
		
		partial void OnCreateTable(string name);
		public Table CreateTable(string name) 
		{
			Table __newFragment = new Table(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnCreateTable(name);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}
	public partial class Table : FluentStateBase
	{
		
		public Table(string name){
			this.Name = name;
		}
		
		#region Data
		public string Name {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnDelete(string name);
		public Table Delete(string name) 
		{
			Table __newFragment = new Table(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnDelete(name);
			return __newFragment;
		}
		
		
		partial void OnGetColumn(string name);
		public Column GetColumn(string name) 
		{
			Column __newFragment = new Column(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnGetColumn(name);
			return __newFragment;
		}
		
		
		partial void OnAddColumn(string name, string datatype, bool allowNulls);
		public Column AddColumn(string name, string datatype, bool allowNulls) 
		{
			Column __newFragment = new Column(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnAddColumn(name, datatype, allowNulls);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}
	public partial class Column : FluentStateBase
	{
		
		public Column(string name){
			this.Name = name;
		}
		
		#region Data
		public string Name {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnDelete(string name);
		public Column Delete(string name) 
		{
			Column __newFragment = new Column(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnDelete(name);
			return __newFragment;
		}
		
		
		partial void OnAsPrimarykey(string name);
		public Column AsPrimarykey(string name) 
		{
			Column __newFragment = new Column(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnAsPrimarykey(name);
			return __newFragment;
		}
		
		
		partial void OnCreateFK(string name, Column other);
		public Column CreateFK(string name, Column other) 
		{
			Column __newFragment = new Column(name);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnCreateFK(name, other);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}

	public interface IFragmentVisitor
	{
		void Visit(Database fragment);
		void Visit(Table fragment);
		void Visit(Column fragment);
	}
}